package com.itheima.sky.controller.front;

import com.itheima.sky.entity.Result;
import com.itheima.sky.pojo.Dish;
import com.itheima.sky.service.DishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description SetMealController
 * @Author jiangning
 * @Date 2024-06-29
 */
@RestController
@Slf4j
@RequestMapping("/setmeal")
public class SetMealController {
    @Autowired
    DishService dishService;

    @GetMapping("/list")
    public Result getDishListByCateId(BigDecimal categoryId, Integer status){
        List<Dish> dishList = dishService.getDishByCategoryId(categoryId,status);
        return Result.success(dishList);
    }
}
